﻿using ECommon.Components;
using ESTAR.Infrastructure;
using ESTAR.QueryServices.TaskQueryServices;
using System;
using System.Linq;
using Task.Model;
using Task.Model.Models;
using System.Threading.Tasks;

namespace Task.QueryServices.EFCore
{
    [Component]
    public class TaskQueryServices : QueryServicesCore<TaskBaseInfo>, ITaskQueryServices
    {
        public TaskQueryServices(TaskDbContext DbContext) : base(DbContext)
        {

        }

        public Task<string> GetTaskNameAsync(string Id)
        {
            throw new NotImplementedException();
        }

        public string GetTaskName(string Id)
        {
            var user = QueryNoTracking().Where(n => n.Id == Id).FirstOrDefault();
            return user?.TaskName;
        }
    }
}
